package com.yutianran.springBoot

import com.yutianran.springBoot.clone.Child
import com.yutianran.springBoot.clone.Person
import org.junit.Test

class CloneTest {

    /**
     * 测试Kotlin的Clone
     */
    @Test
    fun test() {
        val tutu = Child("图图")
        val xiaoli = Person(tutu)
        val yingjun = xiaoli.copy()

        println(yingjun.child == xiaoli.child)

        var copyTutu = xiaoli.child.copy("小图图")
        var copyXiaoLi = xiaoli.copy(copyTutu)

        println(yingjun.child == copyXiaoLi.child)
    }

}
